﻿using UnityEngine;
using UnityEngine.UIElements;
using winS.Unity.Process;
using winS.UnityEditor.UIElement;

namespace winS.UnityEditor.ProcessEditor
{
    /// <summary>
    /// 在 <see cref="StepNodeCore{T}"/> 的基础上提供端口容器元素
    /// </summary>
    public class PortStepNode<T> : StepNodeCore<T> where T : class, IStep
    {
        protected virtual Color portContainerBackgroundColor => new Color32(48, 48, 48, 255);

        protected VisualElement portContainer;

        public PortStepNode()
        {
            nodeContent.Insert(1, portContainer = EditorElementUtility.elementFactory.CreateEditorElementWithName("端口容器", portContainerBackgroundColor));
            portContainer.style.marginTop = 2f;
            portContainer.style.flexDirection = FlexDirection.Row;
        }
    }
}